<template>
	<view class="warp">
		<view class="image" v-if="introduce.websiteSellerImage">
			<image style="width: 750rpx;" :src="introduce.websiteSellerImage" mode="widthFix"></image>
			<!-- <image style="height: 200rpx;width: 710rpx;" :src="companyinfo.websiteSellerImage" mode=""></image> -->
		</view>
		<view class="introduce" >
		<jyf-parser :isAll="true" :html="companyinfo" ></jyf-parser>
		</view>
		<view class="bottom" style="margin-bottom: 25%;">
		</view>
	</view>
</template>

<script>
	import jyfParser from '@/components/jyf-parser/jyf-parser'
	import { quillEscapeToHtml } from '@/utils/common.js'
	import { mapState, mapMutations } from 'vuex'
	// 协会介绍
	export default {
		components:{
			jyfParser
		},
		data() {
			return {
				introduce:{},
				queryform:{
					pageSize:20,
					current:1,
					websiteType:'7',//类型
				},
				companyinfo:'',
				total:0,
				type:null
			}
		},
		computed: {
		  ...mapState(['hasLogin', 'userInfo', 'userCenterData'])
		},
		onLoad(e) {
			if(e){
				this.type=e.type
			}
			this.getintroduce()
		},
		// 下拉
			onPullDownRefresh() {
				// 刷新位置
			this.getintroduce()
				var that=this
				setTimeout(function(){
						uni.stopPullDownRefresh()
					},1000)
			},
		methods: {
			getintroduce(){
				if(this.type==1){
					this.queryform.vendorId=this.userCenterData.vendorId
				    this.$request({
				    	url:'v3/website/front/seller/list',
				    	method:'GET',
				    	data:this.queryform
				    }).then(res=>{
				    	if(res.state==200){
				    		this.introduce=res.data.list[0]
				    		this.companyinfo=quillEscapeToHtml(res.data.list[0].websiteSellerContent)
				    	}
				    })
				}else{
					if(uni.getStorageSync('storeId')){
						this.queryform.vendorId=uni.getStorageSync('storeId')
						this.$request({
							url:'v3/website/front/seller/list',
							method:'GET',
							data:this.queryform
						}).then(res=>{
							if(res.state==200){
								this.introduce=res.data.list[0]
								this.companyinfo=quillEscapeToHtml(res.data.list[0].websiteSellerContent)
							}
						})
					}else{
						this.queryform.vendorId='640003'
						this.$request({
							url:'v3/website/front/seller/list',
							method:'GET',
							data:this.queryform
						}).then(res=>{
							if(res.state==200){
								this.introduce=res.data.list[0]
							this.companyinfo=quillEscapeToHtml(res.data.list[0].websiteSellerContent)
							}
						})
					}
				}
				
				// uni.getStorageSync('storeId')
					
				
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
				width: 750rpx;
				margin: 0 auto;
				background: #F5F5F5;
				
			}
.warp{
	.introduce{
		margin-top: 10rpx;
		background-color: #fff;
		padding: 10rpx 20rpx;
	}
}
</style>
